function getGPU(e: WebGLRenderingContext) {
  try {
    const t = e.getExtension("WEBGL_debug_renderer_info")
    if (t)
      return {
        vendor: e.getParameter(t.UNMASKED_VENDOR_WEBGL),
        renderer: e.getParameter(t.UNMASKED_RENDERER_WEBGL)
      }
  } catch (e) {}
  return { vendor: "Unknown", renderer: "Unknown" }
}
function canUseGL(e: any) {
  return /Apple A(9|1\d)/.test(e.renderer) || /Adreno \(TM\) (512|530|540|[6-9]\d\d)/.test(e.renderer) || /Mali-G(7[1-9]|[8-9]\d)/.test(e.renderer)
}

export default {
  getGPU,
  canUseGL
}
